<template>
     <view class="fullscreen-container">
       <image :src="imageUrl + '/tansuofaxian2/tansuofaxian2beijing1.png'" mode="" class="fullscreen-image"></image>
	   <image :src="imageUrl + '/tansuofaxian2/jiancunzhihui.png'" class="mySpan" ></image>
	   <image :src="imageUrl + '/tansuofaxian2/tansuofaxian2baikuang.png'" mode="" class="baibian-image" @click="handleClick"></image>
	   <image :src="imageUrl + '/tansuofaxian2/tansuofaxian2fanhui.png'" mode="" class="fanhui" @click="fanhui"></image>
	   <MusicContror  />
     </view>
   </template>
   
   <script>
  import MusicContror from '../../../common/teding.vue'
  import MusicControl from '../../../common/MusicControl.vue'
  import { playBackgroundMusic, pauseBackgroundMusic, pageSpecificMusicManager, isGlobalMusicPlaying, isPageSpecificMusicPaused } from '../../../common/audio';
export default {
	components: {
	   MusicContror,
	    MusicControl,
	 },
	data(){
		return{
		page7PreviousParam: '',
		imageUrl: this.$imageUrl,	
		}
	},
onLoad(options) {
    this.page7PreviousParam = options.fromPage;
    console.log('传递过来的参数：', page7PreviousParam);
    // 可以根据这个参数进行相应的处理
},
onShow() {
    // 根据全局变量判断是否播放特定页面音乐
      pageSpecificMusicManager.playPageSpecificMusic();
  },
  onHide() {
    // 暂停特定页面音乐并更新全局变量
    pageSpecificMusicManager.pausePageSpecificMusic();
    isPageSpecificMusicPaused = true;
  }, 
  methods: {
   handleClick() {
       const currentPageParam = this.page7PreviousParam? this.page7PreviousParam : '';
       wx.redirectTo({
           url: `/pagesNew/pages-exploration-discovery/Explore the wisdom of village construction/The second page.?fromPage=${currentPageParam}`
       });
   },
	fanhui() {
	  if (this.page7PreviousParam) {
	      wx.redirectTo({
	          url: `/${this.page7PreviousParam}`
	      });
	  } else {
	  wx.redirectTo({
	    url: '/pagesNew/pages-exploration-discovery/index',
	  });
	  }
	  pageSpecificMusicManager.pausePageSpecificMusic();
	
	  if (isGlobalMusicPlaying) {
	    pauseBackgroundMusic();
	  } else {
	    playBackgroundMusic();
	  }
	},
  }
};
    </script>
   
   <style>
	   .fanhui{
		   width: 25px;
		    height: 25px;
		   position: absolute;
		   /* transform: rotate(90deg); */
		   /* border: 2px solid pink; */
		   top: 20px; /* 根据需要调整距离第一个图片顶部的距离 */
		   left: 20px; /* 根据需要调整距离第一个图片左侧的距离 */
	   }
	     .fullscreen-container {
	       position: fixed;
	        top: 0;
	        left: 0;
	        width: 100%;
	        height: 100%;
	        display: flex;
	        justify-content: center;
	        align-items: center;
	      }
	     .fullscreen-image {
	        width: 100%;
	        height: 100%;
	        object-fit: cover;
			border: 2px solid blue;
	        /* transform:  scale(2.2); */
	     }
		 .baibian-image{
			 width:179px;
			 height: 61px;
			position: absolute;
			/* transform: rotate(90deg); */
			 top: 52vh; /* 根据需要调整距离第一个图片顶部的距离 */
						 left: 39vw; /* 根据需要调整距离第一个图片左侧的距离 */
		 }
		 .mySpan{
			 width: 288px;
			 height: 51px;
			 /* border: 2px solid pink; */
			 position: absolute;
			 font-size: 12px;
			 font-weight: 700px;
			 color: #5f9390;
			 /* transform: rotate(90deg) ; */
			 top: 34vh; /* 根据需要调整距离第一个图片顶部的距离 */
			 left: 34vw; /* 根据需要调整距离第一个图片左侧的距离 */
		 }
   </style>